<extend name="template/base_index" />

<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CSS__/wxshop.css">
    <link type="text/css" rel="stylesheet" src="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
    <script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/3.5.2/select2.css" />
    <script type="text/javascript" src="__CDN__/select2/3.5.2/select2.min.js"></script>
    <script type="text/javascript" src="__CDN__/select2/3.5.2/select2_locale_zh-CN.js"></script>
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}

            <div class="col-main">
                <div class="main-hd">
                    <h2>编辑商品</h2>
                </div>
                <div class="main-bd clearfix" style="padding: 0 10px;margin-top: 0px;">
                    <form class="productForm form-horizontal" method="post">
                        <input type="hidden" name="id" value="{$product.id}" />
                        <input type="hidden" name="name" value="{$product.name}" />
                        <input type="hidden" name="has_sku" value="{$product.has_sku}" />

                        <h3><i>●</i>基本信息</h3>
                        <div class="form-group col-lg-12 col-md-12 clearfix">
                            <label for="" class="control-label col-lg-2 col-md-2">商品名称</label>
                            <div class="col-lg-10 col-md-10">{$product.name}

                            </div>
                        </div>

                        <if condition="$product['has_sku'] == 1">
                            <volist name="sku_list"  id="vo">
                                <div class="form-group col-lg-12 col-md-12 clearfix">
                                    <label for="" class="control-label col-lg-2 col-md-2">当前库存</label>
                                    <div class="col-lg-10 col-md-10">{$vo.quantity}(<span class="text-danger">{$vo.sku_desc}</span>)
                                    </div>
                                </div>

                                <div class="form-group col-lg-12 col-md-12 clearfix">
                                    <label for="" class="control-label col-lg-2 col-md-2">库存增减</label>
                                    <div class="col-lg-10 col-md-10">

                                        <input type="hidden" name="quantity[]" value="{$vo.quantity}" />
                                        <input type="hidden" name="sku_id[]" value="{$key}" />
                                        <input type="text" name="putin[]" value="0" />
                                        <span class="help-block">减少为负,加减号；增加无需，例如6，-6 </span>
                                    </div>
                                </div>

                            </volist>

                            <else/>
                            <div class="form-group col-lg-12 col-md-12 clearfix">
                                <label for="" class="control-label col-lg-2 col-md-2">当前库存</label>
                                <div class="col-lg-10 col-md-10">{$product.quantity}
                                </div>
                            </div>
                            <div class="form-group col-lg-12 col-md-12 clearfix">
                                <label for="" class="control-label col-lg-2 col-md-2">库存增减</label>
                                <div class="col-lg-10 col-md-10">
                                    <input type="text" name="putin" value="0" />
                                    <span class="help-block">减少为负,加减号；增加无需，例如6，-6 </span>
                                </div>
                            </div>

                        </if>

                        <div class="form-group col-lg-12 col-md-12 clearfix tool-bar text-center border">
                            <a target-form="productForm" href="{:U('Admin/Product/putin')}"  class="ajax-post btn btn-primary" id="js_submit"><i class="fa fa-check"></i>保存</a>
                            <a href="{:U('Admin/Product/index',array('store_id'=>$vo['store_id'],'onshelf'=>$onshelf,'p'=>$p))}" class="btn btn-default"><i class="fa fa-reply"></i>返回</a>
                        </div>


                    </form>
                </div>
            </div>



    </div>
    <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">


</block>